Skip to content

fix: cargo-auditable build error #1929

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 6, 2025

Conversation

Prince213
Copy link
Contributor

Use futures-lite instead of dep:futures-lite in gix-packetline and gix-protocol.

This currently affects NixOS.

Related:

Copy link
Member

@Byron Byron left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks a lot!

I think there needs to be a comment around these, otherwise these will seem like an oversight and changed back sometime in the future. These comments should contain links for more context.

#1024 is a decent description of what's going on, and it doesn't look like the reported bug in Cargo is fixed yet.

Use `futures-lite` instead of `dep:futures-lite` in gix-packetline and
gix-protocol.

See-Also: rust-secure-code/cargo-auditable#124
@Prince213 Prince213 force-pushed the fix-cargo-auditable branch from 25b6e3d to 11bd59f Compare April 5, 2025 11:45
@Prince213 Prince213 requested a review from Byron April 5, 2025 12:11
Copy link
Member

@Byron Byron left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks a lot!

Copy link
Member

@EliahKagan EliahKagan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is great! I've verified that, starting after this was merged, cargo auditable build -r works to build gitoxide on GNU/Linux, macOS, and Windows.

Now that cargo auditable is working, I hope we will eventually be able to use it for the release binaries built and published on GitHub (see release.yml). However, I think this might not be immediately feasible, because the use of cross for all the Linux builds currently gets in the way (rust-secure-code/cargo-auditable#95 (comment)).

@Byron
Copy link
Member

Byron commented Apr 7, 2025

It's worth noting that this does break the project discovery step of RustRover, which now looks like this.

Screenshot 2025-04-07 at 13 45 29

Here is the plain text of the error message for posterity:

error: failed to select a version for `gix-packetline-blocking`.
    ... required by package `gix-filter v0.18.0 (/Users/byron/dev/github.com/Byron/gitoxide/gix-filter)`
    ... which satisfies path dependency `gix-filter` (locked to 0.18.0) of package `gix-diff v0.51.0 (/Users/byron/dev/github.com/Byron/gitoxide/gix-diff)`
    ... which satisfies path dependency `gix-diff` (locked to 0.51.0) of package `gix-pack v0.58.0 (/Users/byron/dev/github.com/Byron/gitoxide/gix-pack)`
    ... which satisfies path dependency `gix-pack` (locked to 0.58.0) of package `gix-odb v0.68.0 (/Users/byron/dev/github.com/Byron/gitoxide/gix-odb)`
    ... which satisfies path dependency `gix-odb` (locked to 0.68.0) of package `gix-object v0.48.0 (/Users/byron/dev/github.com/Byron/gitoxide/gix-object)`
    ... which satisfies path dependency `gix-object` (locked to 0.48.0) of package `gix-ref v0.51.0 (/Users/byron/dev/github.com/Byron/gitoxide/gix-ref)`
versions that meet the requirements `^0.18.3` (locked to 0.18.3) are: 0.18.3
the package `gix-filter` depends on `gix-packetline-blocking`, with features: `futures-lite` but `gix-packetline-blocking` does not have these features.
failed to select a version for `gix-packetline-blocking` which could resolve this conflict

When undoing this PR it works like it did before.
Unfortunately, the invocation isn't exposed, but it looks like it's something that Cargo would output.
To me the error message makes no sense either and seems to be some confusion of Cargo about the way the gitoxide is setup in conjunction with how dep: is implemented.

@EliahKagan
Copy link
Member

One thing that seems strange to me about that error is that it's looking for a futures-lite feature of gix-packetline-blocking. This PR modified gix-packetline, but not gix-packetline-blocking.

@Prince213
Copy link
Contributor Author

Hi @Byron, I initially had an idea of creating a empty feature instead of dropping dep:, could you try if that works?

NixOS/nixpkgs@a32c7d6

@Byron
Copy link
Member

Byron commented Apr 7, 2025

One thing that seems strange to me about that error is that it's looking for a futures-lite feature of gix-packetline-blocking. This PR modified gix-packetline, but not gix-packetline-blocking.

Yes, it's very strange. I would have trouble thinking that cargo could get this confused. So maybe it's more along the lines of an overly broad or wrong cargo invocation.

Hi @Byron, I initially had an idea of creating a empty feature instead of dropping dep:, could you try if that works?

NixOS/nixpkgs@a32c7d6

Thanks for trying to help!

I couldn't really apply this in a straightforward fashion, I don't understand what it is doing, but experimented more. From there I can say that futures-lite as a cargo feature breaks the IDE, no matter if it's manually defined, or if it's implicit due to using futures-lite.
So far code intelligence still seems to work, but I wouldn't say that I am not concerned about this. If in doubt, I may unilaterally revert this just to get the IDE back, and it's hard to say if it's an IDE bug or a bug in cargo.

@EliahKagan
Copy link
Member

EliahKagan commented Apr 7, 2025

Unfortunately, the invocation isn't exposed, but it looks like it's something that Cargo would output.

You can get the specific invocation. The left sub-panel shows this tree view:

  • Cargo: failed
    • Sync gitoxide project
      • Updating workspace info
        • Build script evaluation
          • Failed to select a version for 'git-packetline-blocking'

As shown, you have Failed to select a version for 'git-packetline-blocking' selected. If you click on Build script evaluation, then the output on the right should show a command at the top.

Currently I only have RustRover on Windows, but I am able to produce this there. The full contents of the right sub-panel, when Build script evaluation is selected on the left sub-panel, is the following, in which the first (very long) line is the cargo command that RustRover ran:

C:/Users/ek/.cargo/bin/cargo.exe check --color=always --message-format json-diagnostic-rendered-ansi --workspace --all-targets --features gitoxide/cache-efficiency-debug,gitoxide/crosstermion,gitoxide/default,gitoxide/document-features,gitoxide/fast,gitoxide/fast-safe,gitoxide/futures-lite,gitoxide/gitoxide-core-async-client,gitoxide/gitoxide-core-blocking-client,gitoxide/gitoxide-core-tools,gitoxide/gitoxide-core-tools-archive,gitoxide/gitoxide-core-tools-clean,gitoxide/gitoxide-core-tools-corpus,gitoxide/gitoxide-core-tools-query,gitoxide/http-client-curl,gitoxide/http-client-curl-rustls,gitoxide/http-client-reqwest,gitoxide/is-terminal,gitoxide/lean,gitoxide/lean-async,gitoxide/max,gitoxide/max-control,gitoxide/max-pure,gitoxide/pretty-cli,gitoxide/prodash,gitoxide/prodash-render-line,gitoxide/prodash-render-line-crossterm,gitoxide/prodash-render-tui,gitoxide/small,gitoxide/tracing,gitoxide-core/archive,gitoxide-core/async-client,gitoxide-core/async-io,gitoxide-core/async-net,gitoxide-core/async-trait,gitoxide-core/blocking,gitoxide-core/blocking-client,gitoxide-core/clean,gitoxide-core/corpus,gitoxide-core/default,gitoxide-core/document-features,gitoxide-core/estimate-hours,gitoxide-core/futures-io,gitoxide-core/futures-lite,gitoxide-core/organize,gitoxide-core/query,gitoxide-core/serde,gitoxide-core/tracing,gix/async-network-client,gix/async-network-client-async-std,gix/async-std,gix/attributes,gix/basic,gix/blame,gix/blob-diff,gix/blocking-http-transport-curl,gix/blocking-http-transport-curl-rustls,gix/blocking-http-transport-reqwest,gix/blocking-http-transport-reqwest-native-tls,gix/blocking-http-transport-reqwest-rust-tls,gix/blocking-http-transport-reqwest-rust-tls-trust-dns,gix/blocking-network-client,gix/cache-efficiency-debug,gix/comfort,gix/command,gix/credentials,gix/default,gix/dirwalk,gix/document-features,gix/excludes,gix/extras,gix/gix-archive,gix/gix-status,gix/gix-worktree-stream,gix/hp-tempfile-registry,gix/index,gix/interrupt,gix/mailmap,gix/max-control,gix/max-performance,gix/max-performance-safe,gix/merge,gix/need-more-recent-msrv,gix/pack-cache-lru-dynamic,gix/pack-cache-lru-static,gix/parallel,gix/prodash,gix/progress-tree,gix/regex,gix/revision,gix/revparse-regex,gix/serde,gix/status,gix/tracing,gix/tracing-detail,gix/tree-editor,gix/verbose-object-parsing-errors,gix/worktree-archive,gix/worktree-mutation,gix/worktree-stream,gix/zlib-ng,gix/zlib-ng-compat,gix/zlib-rs,gix/zlib-stock,gix-actor/document-features,gix-actor/serde,gix-archive/default,gix-archive/document-features,gix-archive/tar,gix-archive/tar_gz,gix-archive/zip,gix-attributes/document-features,gix-attributes/serde,gix-commitgraph/document-features,gix-commitgraph/serde,gix-config/document-features,gix-config/serde,gix-config-value/document-features,gix-config-value/serde,gix-credentials/document-features,gix-credentials/serde,gix-date/document-features,gix-date/serde,gix-diff/blob,gix-diff/default,gix-diff/document-features,gix-diff/index,gix-diff/serde,gix-diff/wasm,gix-features/cache-efficiency-debug,gix-features/crc32,gix-features/default,gix-features/document-features,gix-features/fs-read-dir,gix-features/io-pipe,gix-features/once_cell,gix-features/parallel,gix-features/prodash,gix-features/progress,gix-features/progress-unit-bytes,gix-features/progress-unit-human-numbers,gix-features/tracing,gix-features/tracing-detail,gix-features/walkdir,gix-features/zlib,gix-features/zlib-ng,gix-features/zlib-ng-compat,gix-features/zlib-rs,gix-features/zlib-rust-backend,gix-features/zlib-stock,gix-fs/serde,gix-glob/document-features,gix-glob/serde,gix-hash/document-features,gix-hash/serde,gix-ignore/document-features,gix-ignore/serde,gix-index/document-features,gix-index/serde,gix-index-tests/gix-features-parallel,gix-mailmap/document-features,gix-mailmap/serde,gix-merge/document-features,gix-merge/serde,gix-object/document-features,gix-object/serde,gix-object/verbose-object-parsing-errors,gix-odb/document-features,gix-odb/serde,gix-odb-tests/gix-features-parallel,gix-pack/default,gix-pack/document-features,gix-pack/generate,gix-pack/object-cache-dynamic,gix-pack/pack-cache-lru-dynamic,gix-pack/pack-cache-lru-static,gix-pack/serde,gix-pack/streaming-input,gix-pack/wasm,gix-pack-tests/all-features,gix-pack-tests/gix-features-parallel,gix-packetline/async-io,gix-packetline/blocking-io,gix-packetline/default,gix-packetline/document-features,gix-packetline/futures-lite,gix-packetline/serde,gix-packetline-blocking/async-io,gix-packetline-blocking/blocking-io,gix-packetline-blocking/default,gix-packetline-blocking/document-features,gix-packetline-blocking/serde,gix-protocol/async-client,gix-protocol/blocking-client,gix-protocol/document-features,gix-protocol/fetch,gix-protocol/futures-lite,gix-protocol/handshake,gix-protocol/serde,gix-ref/document-features,gix-ref/serde,gix-ref-tests/gix-features-parallel,gix-ref-tests/serde,gix-revision/default,gix-revision/describe,gix-revision/document-features,gix-revision/merge_base,gix-revision/serde,gix-sec/document-features,gix-sec/serde,gix-shallow/serde,gix-status/document-features,gix-status/worktree-rewrites,gix-status-tests/gix-features-parallel,gix-tempfile/default,gix-tempfile/document-features,gix-tempfile/hp-hashmap,gix-tempfile/signals,gix-testtools/default,gix-testtools/document-features,gix-testtools/xz,gix-trace/default,gix-trace/document-features,gix-trace/tracing,gix-trace/tracing-detail,gix-transport/async-client,gix-transport/async-std,gix-transport/async-trait,gix-transport/base64,gix-transport/blocking-client,gix-transport/curl,gix-transport/default,gix-transport/document-features,gix-transport/futures-io,gix-transport/futures-lite,gix-transport/gix-credentials,gix-transport/http-client,gix-transport/http-client-curl,gix-transport/http-client-curl-rust-tls,gix-transport/http-client-insecure-credentials,gix-transport/http-client-reqwest,gix-transport/http-client-reqwest-native-tls,gix-transport/http-client-reqwest-rust-tls,gix-transport/http-client-reqwest-rust-tls-trust-dns,gix-transport/pin-project-lite,gix-transport/reqwest,gix-transport/serde,gix-url/document-features,gix-url/serde,gix-utils/bstr,gix-worktree/attributes,gix-worktree/default,gix-worktree/document-features,gix-worktree/serde,gix-worktree-state-tests/gix-features-parallel,gix-worktree-tests/gix-features-parallel --keep-going

error: failed to select a version for `gix-packetline-blocking`.
    ... required by package `gix-filter v0.18.0 (C:\Users\ek\source\repos\gitoxide\gix-filter)`
    ... which satisfies path dependency `gix-filter` (locked to 0.18.0) of package `gix-diff v0.51.0 (C:\Users\ek\source\repos\gitoxide\gix-diff)`
    ... which satisfies path dependency `gix-diff` (locked to 0.51.0) of package `gix-pack v0.58.0 (C:\Users\ek\source\repos\gitoxide\gix-pack)`
    ... which satisfies path dependency `gix-pack` (locked to 0.58.0) of package `gix-odb v0.68.0 (C:\Users\ek\source\repos\gitoxide\gix-odb)`
    ... which satisfies path dependency `gix-odb` (locked to 0.68.0) of package `gix-object v0.48.0 (C:\Users\ek\source\repos\gitoxide\gix-object)`
    ... which satisfies path dependency `gix-object` (locked to 0.48.0) of package `gix-ref v0.51.0 (C:\Users\ek\source\repos\gitoxide\gix-ref)`
versions that meet the requirements `^0.18.3` (locked to 0.18.3) are: 0.18.3
the package `gix-filter` depends on `gix-packetline-blocking`, with features: `futures-lite` but `gix-packetline-blocking` does not have these features.
failed to select a version for `gix-packetline-blocking` which could resolve this conflict

Whatever is going on, it should be possible to figure it out from the command itself, because running cargo myself in PowerShell with those arguments gives:

error: failed to select a version for `gix-packetline-blocking`.
    ... required by package `gix-filter v0.18.0 (C:\Users\ek\source\repos\gitoxide\gix-filter)`
    ... which satisfies path dependency `gix-filter` (locked to 0.18.0) of package `gix-diff v0.51.0 (C:\Users\ek\source\repos\gitoxide\gix-diff)`
    ... which satisfies path dependency `gix-diff` (locked to 0.51.0) of package `gix-pack v0.58.0 (C:\Users\ek\source\repos\gitoxide\gix-pack)`
    ... which satisfies path dependency `gix-pack` (locked to 0.58.0) of package `gix-odb v0.68.0 (C:\Users\ek\source\repos\gitoxide\gix-odb)`
    ... which satisfies path dependency `gix-odb` (locked to 0.68.0) of package `gix-object v0.48.0 (C:\Users\ek\source\repos\gitoxide\gix-object)`
    ... which satisfies path dependency `gix-object` (locked to 0.48.0) of package `gix-ref v0.51.0 (C:\Users\ek\source\repos\gitoxide\gix-ref)`
versions that meet the requirements `^0.18.3` (locked to 0.18.3) are: 0.18.3

the package `gix-filter` depends on `gix-packetline-blocking`, with features: `futures-lite` but `gix-packetline-blocking` does not have these features.

Edit: What I don't know how to do through RustRover itself is to find out what the cargo invocation is when no error is reported--such as under git revert --no-commit 11bd59f794811e11e48ef8de4db59035434f9da6. I'm pretty sure it's different, at least by specifying fewer features. (If that same command were run, it would refer to nonexistent features and give a “It has an optional dependency with that name, but that dependency uses the "dep:" syntax in the features table, so it does not have an implicit feature with that name” error about gix-packetline.)

Edit 2: It turns out that showing the command when there is no error is straightforward too: right-clicking on the top item in the tree view in the left sub-panel shows a contextual menu one of whose items is "Show Successful Steps". Click that populates the tree and then the items can be expanded, including the "Build script evaluation" item. This reveals that, without the patch here, the command RustRover runs is:

C:/Users/ek/.cargo/bin/cargo.exe check --color=always --message-format json-diagnostic-rendered-ansi --workspace --all-targets --features gitoxide/cache-efficiency-debug,gitoxide/crosstermion,gitoxide/default,gitoxide/document-features,gitoxide/fast,gitoxide/fast-safe,gitoxide/futures-lite,gitoxide/gitoxide-core-async-client,gitoxide/gitoxide-core-blocking-client,gitoxide/gitoxide-core-tools,gitoxide/gitoxide-core-tools-archive,gitoxide/gitoxide-core-tools-clean,gitoxide/gitoxide-core-tools-corpus,gitoxide/gitoxide-core-tools-query,gitoxide/http-client-curl,gitoxide/http-client-curl-rustls,gitoxide/http-client-reqwest,gitoxide/is-terminal,gitoxide/lean,gitoxide/lean-async,gitoxide/max,gitoxide/max-control,gitoxide/max-pure,gitoxide/pretty-cli,gitoxide/prodash,gitoxide/prodash-render-line,gitoxide/prodash-render-line-crossterm,gitoxide/prodash-render-tui,gitoxide/small,gitoxide/tracing,gitoxide-core/archive,gitoxide-core/async-client,gitoxide-core/async-io,gitoxide-core/async-net,gitoxide-core/async-trait,gitoxide-core/blocking,gitoxide-core/blocking-client,gitoxide-core/clean,gitoxide-core/corpus,gitoxide-core/default,gitoxide-core/document-features,gitoxide-core/estimate-hours,gitoxide-core/futures-io,gitoxide-core/futures-lite,gitoxide-core/organize,gitoxide-core/query,gitoxide-core/serde,gitoxide-core/tracing,gix/async-network-client,gix/async-network-client-async-std,gix/async-std,gix/attributes,gix/basic,gix/blame,gix/blob-diff,gix/blocking-http-transport-curl,gix/blocking-http-transport-curl-rustls,gix/blocking-http-transport-reqwest,gix/blocking-http-transport-reqwest-native-tls,gix/blocking-http-transport-reqwest-rust-tls,gix/blocking-http-transport-reqwest-rust-tls-trust-dns,gix/blocking-network-client,gix/cache-efficiency-debug,gix/comfort,gix/command,gix/credentials,gix/default,gix/dirwalk,gix/document-features,gix/excludes,gix/extras,gix/gix-archive,gix/gix-status,gix/gix-worktree-stream,gix/hp-tempfile-registry,gix/index,gix/interrupt,gix/mailmap,gix/max-control,gix/max-performance,gix/max-performance-safe,gix/merge,gix/need-more-recent-msrv,gix/pack-cache-lru-dynamic,gix/pack-cache-lru-static,gix/parallel,gix/prodash,gix/progress-tree,gix/regex,gix/revision,gix/revparse-regex,gix/serde,gix/status,gix/tracing,gix/tracing-detail,gix/tree-editor,gix/verbose-object-parsing-errors,gix/worktree-archive,gix/worktree-mutation,gix/worktree-stream,gix/zlib-ng,gix/zlib-ng-compat,gix/zlib-rs,gix/zlib-stock,gix-actor/document-features,gix-actor/serde,gix-archive/default,gix-archive/document-features,gix-archive/tar,gix-archive/tar_gz,gix-archive/zip,gix-attributes/document-features,gix-attributes/serde,gix-commitgraph/document-features,gix-commitgraph/serde,gix-config/document-features,gix-config/serde,gix-config-value/document-features,gix-config-value/serde,gix-credentials/document-features,gix-credentials/serde,gix-date/document-features,gix-date/serde,gix-diff/blob,gix-diff/default,gix-diff/document-features,gix-diff/index,gix-diff/serde,gix-diff/wasm,gix-features/cache-efficiency-debug,gix-features/crc32,gix-features/default,gix-features/document-features,gix-features/fs-read-dir,gix-features/io-pipe,gix-features/once_cell,gix-features/parallel,gix-features/prodash,gix-features/progress,gix-features/progress-unit-bytes,gix-features/progress-unit-human-numbers,gix-features/tracing,gix-features/tracing-detail,gix-features/walkdir,gix-features/zlib,gix-features/zlib-ng,gix-features/zlib-ng-compat,gix-features/zlib-rs,gix-features/zlib-rust-backend,gix-features/zlib-stock,gix-fs/serde,gix-glob/document-features,gix-glob/serde,gix-hash/document-features,gix-hash/serde,gix-ignore/document-features,gix-ignore/serde,gix-index/document-features,gix-index/serde,gix-index-tests/gix-features-parallel,gix-mailmap/document-features,gix-mailmap/serde,gix-merge/document-features,gix-merge/serde,gix-object/document-features,gix-object/serde,gix-object/verbose-object-parsing-errors,gix-odb/document-features,gix-odb/serde,gix-odb-tests/gix-features-parallel,gix-pack/default,gix-pack/document-features,gix-pack/generate,gix-pack/object-cache-dynamic,gix-pack/pack-cache-lru-dynamic,gix-pack/pack-cache-lru-static,gix-pack/serde,gix-pack/streaming-input,gix-pack/wasm,gix-pack-tests/all-features,gix-pack-tests/gix-features-parallel,gix-packetline/async-io,gix-packetline/blocking-io,gix-packetline/default,gix-packetline/document-features,gix-packetline/serde,gix-packetline-blocking/async-io,gix-packetline-blocking/blocking-io,gix-packetline-blocking/default,gix-packetline-blocking/document-features,gix-packetline-blocking/serde,gix-protocol/async-client,gix-protocol/blocking-client,gix-protocol/document-features,gix-protocol/fetch,gix-protocol/handshake,gix-protocol/serde,gix-ref/document-features,gix-ref/serde,gix-ref-tests/gix-features-parallel,gix-ref-tests/serde,gix-revision/default,gix-revision/describe,gix-revision/document-features,gix-revision/merge_base,gix-revision/serde,gix-sec/document-features,gix-sec/serde,gix-shallow/serde,gix-status/document-features,gix-status/worktree-rewrites,gix-status-tests/gix-features-parallel,gix-tempfile/default,gix-tempfile/document-features,gix-tempfile/hp-hashmap,gix-tempfile/signals,gix-testtools/default,gix-testtools/document-features,gix-testtools/xz,gix-trace/default,gix-trace/document-features,gix-trace/tracing,gix-trace/tracing-detail,gix-transport/async-client,gix-transport/async-std,gix-transport/async-trait,gix-transport/base64,gix-transport/blocking-client,gix-transport/curl,gix-transport/default,gix-transport/document-features,gix-transport/futures-io,gix-transport/futures-lite,gix-transport/gix-credentials,gix-transport/http-client,gix-transport/http-client-curl,gix-transport/http-client-curl-rust-tls,gix-transport/http-client-insecure-credentials,gix-transport/http-client-reqwest,gix-transport/http-client-reqwest-native-tls,gix-transport/http-client-reqwest-rust-tls,gix-transport/http-client-reqwest-rust-tls-trust-dns,gix-transport/pin-project-lite,gix-transport/reqwest,gix-transport/serde,gix-url/document-features,gix-url/serde,gix-utils/bstr,gix-worktree/attributes,gix-worktree/default,gix-worktree/document-features,gix-worktree/serde,gix-worktree-state-tests/gix-features-parallel,gix-worktree-tests/gix-features-parallel --keep-going

Using this diff tool reveals that the difference is that, when the changes from this PR are present, RustRover includes gix-packetline/futures-lite and gix-protocol/futures-lite in the comma-separated list of features passed to cargo.

Of those, the first, gix-packetline/futures-lite, seems to be the culprit. This command seems to be the minimal reproducer for the failure:

cargo check --workspace --features gix-packetline/futures-lite

The output is:

error: failed to select a version for `gix-packetline-blocking`.
    ... required by package `gix-filter v0.18.0 (C:\Users\ek\source\repos\gitoxide\gix-filter)`
    ... which satisfies path dependency `gix-filter` (locked to 0.18.0) of package `gix-diff v0.51.0 (C:\Users\ek\source\repos\gitoxide\gix-diff)`
    ... which satisfies path dependency `gix-diff` (locked to 0.51.0) of package `gix-pack v0.58.0 (C:\Users\ek\source\repos\gitoxide\gix-pack)`
    ... which satisfies path dependency `gix-pack` (locked to 0.58.0) of package `gix-odb v0.68.0 (C:\Users\ek\source\repos\gitoxide\gix-odb)`
    ... which satisfies path dependency `gix-odb` (locked to 0.68.0) of package `gix-object v0.48.0 (C:\Users\ek\source\repos\gitoxide\gix-object)`
    ... which satisfies path dependency `gix-object` (locked to 0.48.0) of package `gix-ref v0.51.0 (C:\Users\ek\source\repos\gitoxide\gix-ref)`
versions that meet the requirements `^0.18.3` (locked to 0.18.3) are: 0.18.3

the package `gix-filter` depends on `gix-packetline-blocking`, with features: `futures-lite` but `gix-packetline-blocking` does not have these features.


failed to select a version for `gix-packetline-blocking` which could resolve this conflict

If this command is something that should work, then further changes will be needed, and if they cannot be made, then this PR could be reverted--though my guess is that knowing gix-packetline/futures-lite is sufficient to produce it may facilitate a solution that allows the changes here to be kept. In contrast, if the problem is instead that RustRover is running a command that should not work, then I strongly suspect RustRover can be configured in a way that will keep it from doing that.

Edit 3: I believe the problem arises because gix-filter depends on gix-packetline-blocking as gix-packetline (that is, it uses the name gix-packetline as an alias for gix-packetline-blocking):

gix-packetline = { package = "gix-packetline-blocking", version = "^0.18.3", path = "../gix-packetline-blocking" }

Based on this, I think there are three potentially reasonable ways forward, any of which should fortunately both preserve the changes in this PR and make RustRover usable again:

  1. If gix-packetline-blocking is meant to be usable, at least in terms of its interface, as a drop-in replacement for gix-packetline, then it should offer corresponding features, even if those features do nothing and should generally not be used. This feels weird and inelegant, but we seem already to be doing it. After all, gix-packetline-blocking has an async-io feature!

    ## DO NOT USE, use instead `gix-packetline` directly.
    async-io = []

    That was added in: Make gix crates ready for automatic cfg checking #1123

  2. If gix-packetline-blocking is not meant to be used as a drop-in replacement for gix-packetline, then gix-filter should not use it with the name gix-packetline in a way that causes gix-packetline configuration to be applied. For example, perhaps gix-filter could depend on gix-packetline-blocking without using an alias.

    (I am assuming that enabling features through aliases is an intended cargo behavior. If not, and that's the source of the problem, then the solution would be to fix this in cargo. But changing how gix-filter depends on gix-packetline-blocking would still be needed as a workaround in the meantime.)

  3. If gix-packetling-blocking is meant to be usable, at least in terms of its interface, as a drop-in replacement for gix-packetline, but the semantics entailed by doing so are not intended for gix-filter, then both (1) and (2) should be done.

The current situation seems sufficiently similar to #1123, especially with respect to the motive for adding async-io as a feature to gix-packetline-blocking with a comment discouraging its use, that I think either (1) or (3) is probably the way to go. Since (3) entails (1) anyway, I'll look into (1) and see if it can fix the problem, even if it might not (or might not, by itself) ultimately be the best approach.

EliahKagan added a commit to EliahKagan/gitoxide that referenced this pull request Apr 7, 2025
This adds a `futures-lite` feature to `gix-packetline-blocking`.

The new feature is undocumented except for the warning not to use
it. It does nothing, and its purpose is to support an existing
internal use of `gix-packetline-blocking` through an alias named
`gix-packetline`.

This new feature should never be used except to keep `cargo check`
commands with `--workspace` that list `gix-packetline/futures-lite`
from failing due to the absent feature. Such `cargo check` commands
are rare and `cargo check` should not typically be used this way.
But RustRover automatically composes and runs such a command. This
fixes a RustRover project discovery breakage commented on in GitoxideLabs#1929.

This "ghost feature" may be removed without warning. Nothing should
rely on it in production or otherwise in a significant way. It is a
bug for any software to break or change behavior if it is removed.

This addition is similar to the addition in be4de0d (GitoxideLabs#1123) of the
`async-io` feature of `gix-packetline-blocking`, which likewise
shouldn't be used. However, `gix-packetline-blocking/futures-lite`
is even less elegant than `gix-packetline-blocking/async-io`,
since `gix-packetline` doesn't explicitly delcare a `futures-lite`
feature. Instead, we currrently don't use `dep:` for `futures-lite`
because it breaks `cargo-auditable` (GitoxideLabs#1929).
EliahKagan added a commit to EliahKagan/gitoxide that referenced this pull request Apr 8, 2025
This removes the `gix-packetline-blocking/futures-lite` "ghost
feature" added in d5dd239 (GitoxideLabs#1939), and instead:

- Changes `gix-filter` to depends on `gix-packetline-blocking`
  without aliasing it `gix-packetline`.

- Replaces uses of `gix_packetline` with `gix_packetline_blocking`
  in the code of `gix-filter`.

Thus, this replaces the solution in GitoxideLabs#1939 for the problem discussed
in GitoxideLabs#1929 (comment)
with a different solution that avoids carrying a "ghost feature."

In contrast, the long-standing `gix-packetline-blocking/async-io`
feature added in be4de0d (GitoxideLabs#1123), though it should not be used,
is *not* removed, because:

- It is referenced in attributes in `gix-packetline-blocking` code
  (because `gix-packetline-blocking/src` is copied from
  `gix-packetline/src` via `etc/copy-packetline.sh`). So removing
  it would cause the `clippy` run in the CI `lint` job to fail, as
  well as likely making various other reasonable operations fail.
EliahKagan added a commit to EliahKagan/gitoxide that referenced this pull request Apr 8, 2025
This removes the `gix-packetline-blocking/futures-lite` "ghost
feature" added in d5dd239 (GitoxideLabs#1939), and instead:

- Changes `gix-filter` to depends on `gix-packetline-blocking`
  without aliasing it `gix-packetline`.

- Replaces uses of `gix_packetline` with `gix_packetline_blocking`
  in the code of `gix-filter`.

Thus, this replaces the solution in GitoxideLabs#1939 for the problem discussed
in GitoxideLabs#1929 (comment)
with a different solution that avoids carrying a "ghost feature."

In contrast, the long-standing `gix-packetline-blocking/async-io`
feature added in be4de0d (GitoxideLabs#1123), though it should not be used,
is *not* removed, because:

- It is referenced in attributes in `gix-packetline-blocking` code
  (because `gix-packetline-blocking/src` is copied from
  `gix-packetline/src` via `etc/copy-packetline.sh`).

- For that reason, removing it would cause the `clippy` run in the
  CI `lint` job to fail, as well as likely making various other
  reasonable operations fail.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants